<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>productList</title>
</head>
<body>
<div th:include="back/common/css_js :: main"></div>
<div class="container">
    <div class="mt-3 mb-3">
        <a th:href="@{/passenger/shoppingCart}" class="btn btn-success">
            <svg class="bi bi-cart3" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor"
                 xmlns="http://www.w3.org/2000/svg">
                <path fill-rule="evenodd"
                      d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .49.598l-1 5a.5.5 0 0 1-.465.401l-9.397.472L4.415 11H13a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l.84 4.479 9.144-.459L13.89 4H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm7 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/>
            </svg>
        </a>
    </div>
    <table class="table">
        <tr>
            <th>编号</th>
            <th>景点名称</th>
            <th>价格</th>
            <th>景点介绍</th>
            <th>操作</th>
        </tr>
        <tr th:each="one,star:${ListSpot}">
            <td th:text="${star.count}"/>
            <!--            <td th:text="${one.id}"/>-->
            <td th:text="${one.scenicSpot}"/>
            <td th:text="${one.price}"/>
            <td th:text="${one.introduce}"/>
            <td><a th:href="@{/passenger/buy}" class="btn btn-primary btn-sm">购买</a>
                <a th:href="@{'/passenger/goShopping/' + ${one.scenicSpot} + '/' + ${one.price}}" class="btn
                btn-primary btn-sm" onclick="return addShoppingCart()">加入购物车</a>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    function addShoppingCart() {
        parent.alert("添加购物车成功")
    }
</script>
</body>
</html>